package at.ltasat.classifier;

public final class Clazz<D> {
	private final int id;
	private final D data;

	Clazz(int id, D data) {
		this.id = id;
		this.data = data;
	}
	
	public int getId(){
		return id;
	}

	public D getData() {
		return data;
	}
	
	@Override
	public int hashCode(){
		return id;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Clazz<?>){
			Clazz<?> other = (Clazz<?>) obj;
			return id == other.id;
		}
		return false;
	}
	
	@Override
	public String toString(){
		return id + "='" + data + "'";
	}
}
